package checker;

import java.sql.Date;

import form.AssetForm.AssetForm;

public class AddAssetFormChecker implements AssetFormChecker {

	@Override
	public String getErrorMsg(AssetForm assetForm) {
		
		Date dateAcquired = Date.valueOf(assetForm.getDateAcquired().getInput());
		Date retentionPeriod = Date.valueOf(assetForm.getRetentionPeriod().getInput());
		
		if(dateAcquired.compareTo(retentionPeriod) >= 0)
			return "Retention Period must come after Date Acquired.";
		
		return "";
	}

}
